package save
{
	/**
	 * @author kings
	 * @E-mail: qywangweiqiang@126.com
	 * 2012-12-1下午03:51:21
	 * */
	public class CodeInfo
	{
		static private var codeInfo:CodeInfo=new CodeInfo();
		
		private var _classAllStr:String="";
		
		private var _packageName:String="";
		//类名
		private var _className:String="";
		private var _importStr:String="";
		
		//全局变量
		private var _wholeVar:String="";
		
		private var _classContentStr:String="";
		
		
		public function CodeInfo()
		{
			
		}
		static public function instance():CodeInfo{
			return codeInfo;
		}
		
		public function get classAllStr():String
		{
			return "package "+packageName + "\n" + "{" + "\n" 
				+importStr 
				+ "\n"
				+"public class "+className+" extends Sprite\n" 
				+ "{" + "\n" 
				+_wholeVar+"\n"
				+"public function "+className+"()" + "\n" + "{" 
				+ "\n" + classContentStr + "}"
				+ "\n" + "}"
				+ "\n" + "}" ;
		}
		
		public function set classAllStr(value:String):void
		{
			_classAllStr = value;
		}
		
		public function get importStr():String
		{
			return _importStr
		}
		
		public function set importStr(value:String):void
		{
			if(_importStr.indexOf(value)!=-1){
				return;
			}
			_importStr +="import "+ value+ ";\n";
		}
		
		public function get classContentStr():String
		{
			return _classContentStr;
		}
		
		public function set classContentStr(value:String):void
		{
			_classContentStr = value;
		}
		
		public function get className():String
		{
			return _className;
		}
		
		public function set className(value:String):void
		{
			_className = value;
		}
		
		public function get packageName():String
		{
			return _packageName;
		}
		
		public function set packageName(value:String):void
		{
			_packageName = value;
		}
		
		public function get wholeVar():String
		{
			return _wholeVar;
		}
		
		public function set wholeVar(value:String):void
		{
			if(_wholeVar.indexOf(value)==-1){
				_wholeVar = value;
			}
		}
		
		
	}
	
	//end class
}